<%@page import="bean.entity.Announce"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="./css/global.css" />
<link rel="stylesheet" type="text/css" href="./css/announce/modifyAnnounce.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="./js/jquery.form.js"></script>
<script type="text/javascript" src="./js/jquery.validate.min.js"></script>
<script type="text/javascript" src="../js/announce/modifyAnnounce.js"></script>
<script type="text/javascript" src="./js/dropdown.js"></script>
<script type="text/javascript" src="./js/slideshow.js"></script>
<title>修改重要公告</title>
</head>
<body>
	<jsp:include page="../title.jsp"></jsp:include>
	<div id="contentDiv">
		<jsp:include page="../left.jsp"></jsp:include>
		<div id="rightDiv">
			<h1 id="titleH1">修改重要公告</h1>
			<div id="modifyAnnounceDiv">
				<form id="modifyAnnounceForm" method="post" action="./modifyAnnounce">
					<%
						Announce ann = (Announce)request.getAttribute("ann");
					%>
					<table id="modifyAnnounceTable">
						<tr>
							<td>標題</td>
							<td>
								<input id="modifyTitleText" type="text" name="title" value="<%=ann.getTitle()%>" />
							</td>
						</tr>
						<tr>
							<td>內容</td>
							<td>
								<textarea id="modifyAnnounceContent" name="content"><%=ann.getContent()%></textarea>
								<script type="text/javascript">
									$(document).ready(function() {
										var content = $("#modifyAnnounceContent").val();
										
										$("#modifyAnnounceContent").val(content.replace(/<br \/>/g, "\n"));
									});
								</script>
							</td>
						</tr>
						<tr>
							<td></td>
							<td>
								<input id="modifyAnnounceSubmit" type="submit" value="修改" />
							</td>
						</tr>
					</table>
					<input type="hidden" name="id" value="<%=request.getParameter("id")%>" />
				</form>
			</div>
		</div>
	</div>
	<jsp:include page="../bottom.jsp"></jsp:include>
</body>
</html>